/**  
 * @Title: AdSlide.java
 * @Package com.nubb.model
 * @author maoyun(maoyun0903@163.com)
 * @date 2014-3-27 下午01:33:56
 * @version V1.0
 */ 
package com.limit.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;

/** 
 * 广告幻灯片<br/>
 * @author maoyun(maoyun0903@163.com)
 * @date 2014-3-27 下午01:33:56 
 * @version V1.0
 */

public class AdSlide extends Model<AdSlide> {
	
	public final static AdSlide dao = new AdSlide();
	
	/**
	 * 前台调用。 不包括已被禁用的记录
	 */
	public List<AdSlide> getSiteLists(){
		
		return AdSlide.dao.find("select * from ad_slide where disable=? order by sort_id desc limit ?" , -1 , 6);
	}

	/** 
	 * 
	 */
	public Page<AdSlide> pageAllList(int p , int pageSize) {
		return AdSlide.dao.paginate(p, pageSize, "select *", "from ad_slide order by sort_id desc");
	}
	
}
